package ro.one.gaeql.model;

import java.util.List;

public class Function implements Evaluable {
	private static final long serialVersionUID = 1L;
	
	String name;
	List<Evaluable> arguments;
	
	public Function(String name, List<Evaluable> arguments) {
		this.name = name;
		this.arguments = arguments;
	}
	
	@Override
	public Object eval(EvalContext context) {
		ExternalFunction extFunction = context.getFunction(this.name);
		return extFunction.eval(arguments);
	}
}
